class Teste
    attr_reader :desc, :created_at;
    def initialize(desc)
       @desc = desc;
       @created_at = Time.now;
    end
    def initialize_copy(orig)
       @desc = orig.desc + " Clonada!";
       @created_at = Time.now;
    end
    def to_s
       return "#{@desc.to_s} - #{friendly_time}";
    end
    def friendly_time
       time = @created_at.to_a;
       secs = time[0].to_s;
       mins = time[1].to_s;
       hrs  = time[2].to_s;
       secs = "0"+secs if secs.size == 1;
       mins = "0"+mins if mins.size == 1;
       hrs  = "0"+hrs if hrs.size == 1;
       return "#{hrs}:#{mins}:#{secs}"
    end
    private :friendly_time;
end

def putss(*args)
    args.each {|str| puts str unless str.nil?;}
end

t1 = Teste.new("Teste1").freeze;
sleep(2)
t2 = t1.clone
putss t1.to_s, t2.to_s, t1.object_id, t2.object_id
